<template>
    <div class="">
        <!-- 头部导航栏 -->
        <div class="head">
            <h3>食谱秀网</h3>
            <svg class="icon icon-caidan" aria-hidden="true" @click="show = !show">
                <use xlink:href="#icon-caidan"></use>
            </svg>
            <!-- 头部隐藏栏 -->
            <transition name="fade">
                <ul class="tab" v-if="!show">
                    <router-link to="/index">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-icons_statistics"></use>
                                </svg>
                                首页
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/classify">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-tag"></use>
                                </svg>
                                食材分类
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/Cookbook">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-tag"></use>
                                </svg>
                                菜谱大全
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/HomeCooked">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-tag"></use>
                                </svg>
                                家常菜谱
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/restriction">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-star"></use>
                                </svg>
                                食物相克
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/PregnantDiet">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-tag"></use>
                                </svg>
                                孕妇食谱
                            </span>
                        </li>
                    </router-link>
                    <router-link to="/FoodInformation">
                        <li>
                            <span>
                                <svg class="icon" aria-hidden="true">
                                    <use xlink:href="#icon-tag"></use>
                                </svg>
                                美食资讯
                            </span>
                        </li>
                    </router-link>
                </ul>
            </transition>
        </div>
        <!-- 按钮切换 -->
        <div class="change">
            <div class="left">
                <img src="../../assets/images/QR code/qrcode.png" alt="">
                <p class="tip3">关注食谱秀公众号</p>
            </div>
            <div class="right">
                <img src="../../assets/images/QR code/android_code.png" alt="">
                <p class="tip4">适用于Android设备</p>
            </div>
            <button class="tip1">点击下载Android版</button>
            <router-link to="/index">
                <button class="tip2">进入网站首页</button>
            </router-link>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            show:true
        }
    },
    mounted(){
        // 获取数据
        this.$http.get('../../data/data.json')
        .then((response)=> {

        })
        .catch(function (error) {
            console.log(error);
        })
        .then(function () {
            // always executed
        });
    }
}
</script>

<style scoped>
    .change{
        height: 100vh;
        background: #f5f5f5;
    }
    .change .tip1,.change .tip2{
        width: 49%;
        height: 6vh;
        border-radius: 25px;
        background: rgba(253, 95, 94, 0.85);
        font-size: 18px;
    }
    .change .tip1{
        margin-top: 50px;
    }
    .left,.right{
        width: 25%;
        height: 15vh;
        float: left;
        margin-right: 20px;
        margin-top: 50px;
        background: rosybrown;
    }
    .left{
        margin-left: 90px;
    }
    .left img,.right img{
        width: 100%;
        height: 15vh;
        margin-bottom: 30px;
    }
    .tip3,.tip4{
        color: #ffffff;
        font-size: 12px;
        background: rgba(253, 95, 94, 0.85);
        margin-top: -75px;
        height: 5vh;
    }
</style>